<?
	global $apps;
?>
	var NewUser = function(){
		ajaxExec('newUser');
	};
	
	var NewDomain = function(){
		var domname = TUXprompt('New Domain ID:', '', function(a){
			if(!a) return;														  
			domname = a.replace('/[^A-Za-z]/', '').toLowerCase();
			if(domname.length != 8)	return TUXalert('"'+a+'" is not an 8 character alphabetic string', NewDomain, {onSubmit:ef()});
			TUX.bequiet()
			ajaxExec('newDomain', {'dom_id':domname});
		}, {footer:'<small>Must be 8 characters of the english alphabet</small>', onSubmit:Prototype.emptyFunction});
	};
	
	
	var NewGroup = function(){
		ajaxExec('newGroup');
	};
	
	var NewDatabase = function(){
		ajaxExec('newDatabase');
	};
	
	var DuplicateDatabase = function(){
		var dbn = Selected(1).name;
		ajaxExec('duplicateDatabase', {dbn:dbn});
	};
	
	var DeleteDatabase = function(){
		var dbn = Selected(1).name;
		TUXconfirm('Are you sure you want to delete "'+dbn+'"?', function(a){
			if(!a) return;
			ajaxExec('deleteDatabase', {dbn:dbn});
		});
	};

	window.onload = function(){
		Chrome.load({
			Selection:0
		});
		Apps.clickHandler = function(a){
			window.location.href = window.location.pathname + '/' + this.rel;
		};
		Apps.load(<?=$apps?>);
		Chrome.mkMCFrame();
		Apps.loaded = function(){
			MC.redraw();
		}
	}
